# -------------------------------------------------------------------------- --
#     AUTHOR                   : Yanzhongqian
#     FILE NAME                : config.sh
#     FILE DESCRIPTION         : Linux shell script file
#     FIRST CREATION DATE      : 2020/12/02
# --------------------------------------------------------------------------
#     Version                  : 1.0
#     Last Change              : 2020/12/02
## ************************************************************************** ##
#!/bin/bash
#-----------------------------------------------------------
#                COLOUR VARIABLES
#-----------------------------------------------------------
UNDL="\033[4m"    F6_E="\033[0m"    B_WT="\033[47m"
F_BL="\033[30m"   F_RD="\033[31m"   F_GR="\033[32m"
F_YL="\033[33m"   F_BU="\033[34m"   F_PU="\033[35m"
F_DG="\033[36m"   F_WT="\033[37m"   B_BL="\033[40m"
B_RE="\033[41m"   B_GR="\033[42m"   B_YL="\033[43m"
B_BU="\033[44m"   B_PR="\033[45m"   B_DG="\033[46m"

#-----------------------------------------------------------
#                  MAIN PROCESS
#-----------------------------------------------------------
if [ -e ~/.gitconfig ]; then
    mv ~/.gitconfig ~/gitconfig_bkp
    rm -rf ~/.gitconfig
fi

if [ -e ~/.gitmessage.txt ];then
    mv ~/.gitmessage.txt ~/gitmessage_bkp.txt
    rm -rf ~/.gitmessage.txt
fi

ln -sf  $(pwd)/gitconfig ~/.gitconfig && \
    ln -sf $(pwd)/gitmessage.txt ~/.gitmessage.txt

if [ $? -ne 0 ];then
    echo -e "\t\t\033[31;47m  link failed, please check !\033[0m\n"
fi

